class Inversion(object):
    def inversion(self, data):
        # data = data #type:str
        # 先将bytes数据转换成str
        data=str(data, encoding='utf-8')
        # 切割
        val=data.split('x')[-1]
        val_list=list()
        for i in range(0, len(val), 2):
            val_list.append(val[i:i + 2:1])
        new_val_list=val_list[::-1]
        new_data=''.join(new_val_list)
        new_data='0x' + new_data
        return int(new_data, 16)

    # 将数据从低位在前变为高位在前
    def reversal(self, data):
        # data = data #type:str
        # 先将bytes数据转换成str
        if isinstance(data, bytes):
            data=str(data, encoding='utf-8')
        # 切割
        val=data.split('x')[-1]
        val_list=list()
        for i in range(0, len(val), 2):
            val_list.append(val[i:i + 2:1])
        new_val_list=val_list[::-1]
        new_data=''.join(new_val_list)
        new_data='0x' + new_data
        return new_data